Releases: azjezz/psl
Lavi - 1.5.0
Components:
- Introduced IO component
- Introduced Filesystem component
- Introduced Shell component
- Introduced Html component
Features:
- added
Psl\Shell\execute
function - added
Psl\Shell\escape_argument
function - added
Psl\Shell\escape_command
function - added
Psl\Filesystem\SEPARATOR
constant - added
Psl\Filesystem\change_group
function - added
Psl\Filesystem\change_owner
function - added
Psl\Filesystem\change_permissions
function - added
Psl\Filesystem\copy
function - added
Psl\Filesystem\create_directory
function - added
Psl\Filesystem\create_file
function - added
Psl\Filesystem\delete_directory
function - added
Psl\Filesystem\delete_file
function - added
Psl\Filesystem\exists
function - added
Psl\Filesystem\file_size
function - added
Psl\Filesystem\get_group
function - added
Psl\Filesystem\get_owner
function - added
Psl\Filesystem\get_permissions
function - added
Psl\Filesystem\get_basename
function - added
Psl\Filesystem\get_directory
function - added
Psl\Filesystem\get_extension
function - added
Psl\Filesystem\get_filename
function - added
Psl\Filesystem\is_directory
function - added
Psl\Filesystem\is_file
function - added
Psl\Filesystem\is_symbolic_link
function - added
Psl\Filesystem\is_readable
function - added
Psl\Filesystem\is_writable
function - added
Psl\Filesystem\canonicalize
function - added
Psl\Filesystem\is_executable
function - added
Psl\Filesystem\read_directory
function - added
Psl\Filesystem\read_file
function - added
Psl\Filesystem\read_symbolic_link
function - added
Psl\Filesystem\append_file
function - added
Psl\Filesystem\write_file
function - added
Psl\Filesystem\create_temporary_file
function - added
Psl\Filesystem\create_hard_link
function - added
Psl\Filesystem\create_symbolic_link
function - added
Psl\Filesystem\get_access_time
function - added
Psl\Filesystem\get_change_time
function - added
Psl\Filesystem\get_modification_time
function - added
Psl\Filesystem\get_inode
function - added a new
Psl\Regex\replace_by
function. - added an optional
?int $limit = null
parameter toPsl\Regex\replace
- added an optional
?int $limit = null
parameter toPsl\Regex\replace_every
- added
Psl\Html\encode
function - added
Psl\Html\encode_special_characters
function - added
Psl\Html\decode
function - added
Psl\Html\decode_special_characters
function - added
Psl\Html\strip_tags
function - added
Psl\Type\literal_scalar
function - added
Psl\Type\optional
function - added
Psl\Type\TypeInterface::isOptional
method - added
Psl\IO\input_handle
function - added
Psl\IO\output_handle
function - added
Psl\IO\error_handle
function - added
Psl\IO\CloseHandleInterface
interface - added
Psl\IO\CloseReadHandleInterface
interface - added
Psl\IO\CloseReadWriteHandleInterface
interface - added
Psl\IO\CloseSeekHandleInterface
interface - added
Psl\IO\CloseSeekReadHandleInterface
interface - added
Psl\IO\CloseSeekReadWriteHandleInterface
interface - added
Psl\IO\CloseSeekWriteHandleInterface
interface - added
Psl\IO\CloseWriteHandleInterface
interface - added
Psl\IO\HandleInterface
interface - added
Psl\IO\ReadHandleInterface
interface - added
Psl\IO\ReadWriteHandleInterface
interface - added
Psl\IO\SeekHandleInterface
interface - added
Psl\IO\SeekReadHandleInterface
interface - added
Psl\IO\SeekReadWriteHandleInterface
interface - added
Psl\IO\SeekWriteHandleInterface
interface - added
Psl\IO\WriteHandleInterface
interface - added
Psl\IO\Writer
class - added
Psl\IO\Reader
class - added
Psl\IO\MemoryHandle
class
Lavi - 1.4.1
Fixes:
Psl\Json\typed
now accepts any implementation ofType\TypeInterface
( previously, only implementation ofType\Type
were allowed )
Lavi - 1.3.1
Fixes:
Psl\Json\typed
now accepts any implementation ofType\TypeInterface
( previously, only implementation ofType\Type
were allowed )
Lavi - 1.4.0
Features:
- added
Psl\Regex\matches
function - added
Psl\Regex\replace
function - added
Psl\Regex\replace_every
function - added
Psl\Regex\split
function - added
Psl\Vec\filter
function - added
Psl\Vec\filter_keys
function - added
Psl\Vec\filter_with_key
function - added
Psl\Vec\map
function - added
Psl\Vec\map_with_key
function - added
Psl\Dict\filter_nulls
- added
Psl\Dict\diff
function - added
Psl\Dict\diff_by_key
function - added
Psl\Dict\intersect
function - added
Psl\Dict\intersect_by_key
function
Deprecation:
- deprecated
Psl\Iter\diff_by_key
( usePsl\Dict\diff_by_key
instead ) - deprecated
Psl\Iter\chain
( usePsl\Vec\concat
instead )
Lavi - 1.3.0
Features:
- added
Type\vec
functions that returns a Type ofvec<T>
( akalist<T>
,T[]
) - added
Type\dict
function that returns a Type ofdict<Tk, Tv>
( akaarray<Tk, Tv>
) - added a new
Type\TypeInterface
interface that is implemented by all types. - added
Type::matches($value): bool
method to check if the given value is of that type.
Deprecation:
- all
Type\is_*
functions have been deprecated, useType\string()->matches($value)
instead ofType\is_string($value)
Breaking changes:
- a new method
matches
has been added toType\Type
, if you have a type that extends this base class, you probably won't be effected, unless you have a method in your class namedmatches
.
Lavi - 1.2.0
This release brings 3 new components to PSL, Vec
, Dict
, and Encoding
.
Arr
component has been deprecated in favor of Iter
, Vec
, and Dict
.
We also introduced a new type function Type\shape()
to support object-like-arrays.
Example:
try {
$input = Type\shape([
'name' => Type\string(),
'email' => Type\string(),
'address' => Type\shape([
'country' => Type\string(),
'state' => Type\string(),
'city' => Type\string(),
]),
])->assert($_POST);
} catch (Type\Exception\AssertException) {
// bad request!
}
However, it is not possible to explain the return type for this function to static analysis tools such as psalm, so we have added a psalm plugin that would make your experience using PSL better.
To enable the new Psalm Plugin, follow the instructions in the README.
what difference does the plugin make?
In the example above, if you don't have the plugin enabled, the return type inferred by psalm for assert($_POST)
would be array<string, array<string, string>|string>
, which is correct, but can be more specific, with the help of the newly added plugin, psalm will understand that the return type is actually array{name: string, email: string, address: array{country: string, state: string, city: string}}
, which helps you avoid issues such as accessing an out-of-bound index.
Features:
- added
Psl\Integration\Psalm\Plugin
( psalm-plugin ) - added
Psl\Type\shape
- added
Psl\Vec\chunk
- added
Psl\Vec\chunk_with_keys
- added
Psl\Vec\concat
- added
Psl\Vec\enumerate
- added
Psl\Vec\fill
- added
Psl\Vec\filter_nulls
- added
Psl\Vec\flat_map
- added
Psl\Vec\keys
- added
Psl\Vec\values
- added
Psl\Vec\partition
- added
Psl\Vec\range
- added
Psl\Vec\reductions
- added
Psl\Vec\reproduce
- added
Psl\Vec\reverse
- added
Psl\Vec\shuffle
- added
Psl\Vec\sort
- added
Psl\Vec\sort_by
- added
Psl\Vec\values
- added
Psl\Vec\zip
- added
Psl\Dict\associate
- added
Psl\Dict\drop
- added
Psl\Dict\drop_while
- added
Psl\Dict\equal
- added
Psl\Dict\filter
- added
Psl\Dict\filter_keys
- added
Psl\Dict\filter_with_key
- added
Psl\Dict\flatten
- added
Psl\Dict\flip
- added
Psl\Dict\from_entries
- added
Psl\Dict\from_iterable
- added
Psl\Dict\from_keys
- added
Psl\Dict\group_by
- added
Psl\Dict\map
- added
Psl\Dict\map_keys
- added
Psl\Dict\map_with_key
- added
Psl\Dict\merge
- added
Psl\Dict\partition
- added
Psl\Dict\partition_with_key
- added
Psl\Dict\pull
- added
Psl\Dict\pull_with_key
- added
Psl\Dict\reindex
- added
Psl\Dict\select_keys
- added
Psl\Dict\slice
- added
Psl\Dict\sort
- added
Psl\Dict\sort_by
- added
Psl\Dict\sort_by_key
- added
Psl\Dict\take
- added
Psl\Dict\take_while
- added
Psl\Dict\unique
- added
Psl\Dict\unique_by
- added
Psl\Encoding\Base64\encode
- added
Psl\Encoding\Base64\decode
- added
Psl\Encoding\Hex\encode
- added
Psl\Encoding\Hex\decode
Deprecation:
- deprecated
Psl\Iter\to_array
( usePsl\Vec\values
instead ) - deprecated
Psl\Iter\values
( usePsl\Vec\values
instead ) - deprecated
Psl\Arr\concat
( usePsl\Vec\concat
instead ) - deprecated
Psl\Arr\count
( usePsl\Iter\count
instead ) - deprecated
Psl\Arr\filter_nulls
( usePsl\Vec\filter_nulls
instead ) - deprecated
Psl\Arr\flat_map
( usePsl\Vec\flat_map
instead ) - deprecated
Psl\Arr\keys
( usePsl\Vec\keys
instead ) - deprecated
Psl\Arr\shuffle
( usePsl\Vec\shuffle
instead ) - deprecated
Psl\Arr\sort
( usePsl\Vec\sort
instead ) - deprecated
Psl\Arr\sort_by
( usePsl\Vec\sort_by
instead ) - deprecated
Psl\Arr\values
( usePsl\Vec\values
instead ) - deprecated
Psl\Iter\chunk
( usePsl\Vec\chunk
instead ) - deprecated
Psl\Iter\chunk_with_keys
( usePsl\Vec\chunk_with_keys
instead ) - deprecated
Psl\Iter\filter_nulls
( usePsl\Vec\filter_nulls
instead ) - deprecated
Psl\Iter\flat_map
( usePsl\Vec\flat_map
instead ) - deprecated
Psl\Iter\keys
( usePsl\Vec\keys
instead ) - deprecated
Psl\Iter\range
( usePsl\Vec\range
instead ) - deprecated
Psl\Iter\reductions
( usePsl\Vec\reductions
instead ) - deprecated
Psl\Iter\repeat
( usePsl\Vec\fill
instead ) - deprecated
Psl\Iter\reproduce
( usePsl\Vec\reproduce
instead ) - deprecated
Psl\Iter\reverse
( usePsl\Vec\reverse
instead ) - deprecated
Psl\Iter\zip
( usePsl\Vec\zip
instead ) - deprecated
Psl\Arr\drop
( usePsl\Dict\drop
instead ) - deprecated
Psl\Arr\drop_while
( usePsl\Dict\drop_while
instead ) - deprecated
Psl\Arr\equal
( usePsl\Dict\equal
instead ) - deprecated
Psl\Arr\filter
( usePsl\Dict\filter
instead ) - deprecated
Psl\Arr\filter_with_key
( usePsl\Dict\filter_with_key
instead ) - deprecated
Psl\Arr\filter_keys
( usePsl\Dict\filter_keys
instead ) - deprecated
Psl\Arr\flatten
( usePsl\Dict\flatten
instead ) - deprecated
Psl\Arr\flip
( usePsl\Dict\flip
instead ) - deprecated
Psl\Arr\group_by
( usePsl\Dict\group_by
instead ) - deprecated
Psl\Arr\map
( usePsl\Dict\map
instead ) - deprecated
Psl\Arr\map_with_key
( usePsl\Dict\map_with_key
instead ) - deprecated
Psl\Arr\map_keys
( usePsl\Dict\map_keys
instead ) - deprecated
Psl\Arr\merge
( usePsl\Dict\merge
instead ) - deprecated
Psl\Arr\partition
( usePsl\Dict\partition
instead ) - deprecated
Psl\Arr\select_keys
( usePsl\Dict\select_keys
instead ) - deprecated
Psl\Arr\slice
( usePsl\Dict\slice
instead ) - deprecated
Psl\Arr\sort_by_key
( usePsl\Dict\sort_by_key
instead ) - deprecated
Psl\Arr\sort_with_keys
( usePsl\Dict\sort_with_keys
instead ) - deprecated
Psl\Arr\sort_with_keys_by
( usePsl\Dict\sort_with_keys_by
instead ) - deprecated
Psl\Arr\take
( usePsl\Dict\take
instead ) - deprecated
Psl\Arr\take_while
( usePsl\Dict\take_while
instead ) - deprecated
Psl\Arr\unique
( usePsl\Dict\unique
instead ) - deprecated
Psl\Arr\unique_by
( usePsl\Dict\unique_by
instead ) - deprecated
Psl\Iter\drop
( usePsl\Dict\drop
instead ) - deprecated
Psl\Iter\drop_while
( usePsl\Dict\drop_while
instead ) - deprecated
Psl\Iter\slice
( usePsl\Dict\slice
instead ) - deprecated
Psl\Iter\take
( usePsl\Dict\take
instead ) - deprecated
Psl\Iter\take_while
( usePsl\Dict\take_while
instead ) - deprecated
Psl\Iter\reindex
( usePsl\Dict\reindex
instead ) - deprecated
Psl\Iter\pull
( usePsl\Dict\pull
instead ) - deprecated
Psl\Iter\pull_with_key
( usePsl\Dict\pull_with_key
instead ) - deprecated
Psl\Iter\to_array_with_keys
( usePsl\Dict\from_iterable
instead ) - deprecated
Psl\Iter\map
( usePsl\Dict\map
instead ) - deprecated
Psl\Iter\map_with_key
( usePsl\Dict\map_with_key
instead ) - deprecated
Psl\Iter\map_keys
( usePsl\Dict\map_keys
instead ) - deprecated
Psl\Iter\from_entries
( usePsl\Dict\from_entries
instead ) - deprecated
Psl\Iter\from_keys
( usePsl\Dict\from_keys
instead ) - deprecated
Psl\Iter\product
( no replacement provided ) - deprecated
Psl\Iter\filter
( usePsl\Dict\filter
instead ) - deprecated
Psl\Iter\filter_with_key
( usePsl\Dict\filter_with_key
instead ) - deprecated
Psl\Iter\filter_keys
( usePsl\Dict\filter_keys
instead ) - deprecated
Psl\Iter\flip
( usePsl\Dict\flip
instead ) - deprecated
Psl\Iter\flatten
( usePsl\Dict\flatten
instead ) - deprecated
Psl\Iter\merge
( usePsl\Dict\merge
instead ) - deprecated
Psl\Arr\contains
( usePsl\Iter\contains
instead ) - deprecated
Psl\Arr\contains_key
( usePsl\Iter\contains_key
instead ) - deprecated
Psl\Arr\count
( usePsl\Iter\count
instead ) - deprecated
Psl\Arr\count_values
( usePsl\Dict\count_values
instead ) - deprecated
Psl\Arr\first
( usePsl\Iter\first
instead ) - deprecated
Psl\Arr\firstx
( usePsl\Iter\first
instead ) - deprecated
Psl\Arr\first_key
( usePsl\Iter\first_key
instead ) - deprecated
Psl\Arr\last
( usePsl\Iter\last
instead ) - deprecated
Psl\Arr\lastx
( usePsl\Iter\last
instead ) - deprecated
Psl\Arr\last_key
( usePsl\Iter\last_key
instead ) - deprecated
Psl\Arr\idx
( use$array|$key] ?? $default
instead ) - deprecated
Psl\Arr\at
( use$array[$key]
instead ) - deprecated
Psl\Iter\enumerate
( usePsl\Vec\enumerate
instead )
Lavi - 1.1.1
Bug fixes:
- [Type] fix parameters name in union function #117
Lavi - 1.1.0
Lavi - 1.0.0
[Type] improve typing
Yu - 0.1.2
Fixes:
- add
.github
folder toexport-ignore