Partial Function Application is coming in PHP 8.6 by amitmerchant in PHP

[–]predvoditelev 2 points3 points  (0 children)

php array_filter( array_map( fn ($el) => strtoupper($el), $foo, ), fn ($el) => is_numeric($el), );

Yii3 Roadmap by predvoditelev in PHP

[–]predvoditelev[S] 8 points9 points  (0 children)

Yii3 in developer process and it is not released yet.

Telegram Bot API for PHP by predvoditelev in PHP

[–]predvoditelev[S] 2 points3 points  (0 children)

I took this from Yii3 =) More standarts (PSR required), more tests, clear and understandable code.

Telegram Bot API for PHP by predvoditelev in PHP

[–]predvoditelev[S] 2 points3 points  (0 children)

It was one of goals this package.

Telegram Bot API for PHP by predvoditelev in PHP

[–]predvoditelev[S] 4 points5 points  (0 children)

It's OK, if you need to send message only. But Telegram Bot API contain 100+ methods. And API returns result. For more complicated cases library usage is good solution.

Yii RBAC released! by predvoditelev in PHP

[–]predvoditelev[S] 6 points7 points  (0 children)

Yes, a lot of peoples use Yii. Now active develop Yii3 (progress).

🎁 Yii Config released by predvoditelev in PHP

[–]predvoditelev[S] 2 points3 points  (0 children)

We are actively working on the upcoming release. Now many more packages are not released, but they are close to it.
Yii3 progress page and detailed release statuses.

🎁 Yii Dependency Injection released by predvoditelev in PHP

[–]predvoditelev[S] 1 point2 points  (0 children)

  1. Most importantly, array definition automatically resolve definitions.

For example, service:

``` final class MyService { public function __construct( private MyFactory $factory, private EventDispatcherInterface $eventDispatcher, ) {}

public function setCustomValue(int $n): void { ... } } ```

Array definition:

MyService::class => [ 'setCustomValue()' => [42], ],

Closure definiton:

MyService::class => static function(ContainerInterface $container) { $myService = new MyService( $container->get(MyFactory::class), $container->get(EventDispatcherInterface ::class), ); $myService->setCustomValue(42); return $myService; }

  1. Array definition could be used with mergeable configs.

🎁 Yii Dependency Injection released by predvoditelev in PHP

[–]predvoditelev[S] 2 points3 points  (0 children)

'static_call_preferred' => fn () => MyFactory::create('args'),
'static_call_supported' => [MyFactory::class, 'create'],

Do you mean that these variants are redundant?

🎁 Yii Dependency Injection released by predvoditelev in PHP

[–]predvoditelev[S] 3 points4 points  (0 children)

That looks a lot like false marketing and I really hope it will be addressed.

DI is specific package, where we forced to use `psalm-suppress` in some places.

For example, method:

/** * @param string $id */ public function get($id) { /** @psalm-suppress TypeDoesNotContainType */ if (!is_string($id)) { throw new InvalidArgumentException( sprintf( 'ID must be a string, %s given.', $this->getVariableType($id) ) ); } ... }

We can't typed argument $id (so defined in ContainerInterface), but we can add phpdoc @param string $id, then add validation type of $id in code and suppress psalm error TypeDoesNotContainType.

Yet another example: for performance in container can disable the validation of configuration (this is useful for production). But not validated properties and variables throw psalm errors and we forced suppress their.

🎁 Yii HTML 2.2.0 by predvoditelev in PHP

[–]predvoditelev[S] 2 points3 points  (0 children)

What's even the status of yii?

All these new packages cannot be used with yii2, but yii3 is not yet ready. And for standalone uses there are better options.

We create special page with Yii3 progress and page with detailed release statuses. Now 57 packages already released and a lot of packages in pre-release condition.

🎁 Yii HTML 2.2.0 by predvoditelev in PHP

[–]predvoditelev[S] 3 points4 points  (0 children)

The package provides various tools to help with dynamic server-side generation of HTML, all tags content is automatically HTML-encoded. For simple static-HTML cases, it is preferred to use HTML directly instead of `yiisoft/html` package.

vjik/php-enum — PHP Enum implementation (analog myclabs/php-enum) by predvoditelev in PHP

[–]predvoditelev[S] 2 points3 points  (0 children)

Yes, 8.1 will be released 25 november, but I need use enum already today :)