php

PSR-14: Compound Providers

planet PHP - 2019-04-04(木) 00:45:00
PSR-14: Compound Providers Submitted by Larry on 3 April 2019 - 10:45am

In part 3 of this series we looked at the more common patterns of Providers that may be used with a PSR-14 Event Dispatcher. In part 4 we looked at some more complex cases of Providers. Today, we'll bring them all together: Literally.

Recall that a Provider is responsible only for receiving an Event and returning a list of callables that it believes should be invoked on it, in the order it decides (if it cares). How it does that is up to the implementation. In fact, it's not even required to do so itself at all. A Provider can defer that decision to another Provider if it wishes, or, critically, to multiple Providers.

Continue reading this post on SteemIt.

カテゴリー: php

Voices of the ElePHPant: Interview with Olivia Liddell

phpdeveloper.org - 2019-04-03(水) 22:30:02

@oliravi

Show Notes

Audio

This episode is sponsored by

The post Interview with Olivia Liddell appeared first on Voices of the ElePHPant.

カテゴリー: php

symfony Project Blog: New in Symfony 4.3: Better test assertions

phpdeveloper.org - 2019-04-03(水) 22:30:02
Contributed by Alex Rock and Fabien Potencier in #30813.

In Symfony applications, creating functional tests is simple thanks to the utilities provi...

カテゴリー: php

Akra's DevNotes: Slim 4 Cyclomatic Complexity

phpdeveloper.org - 2019-04-03(水) 22:30:02

There's not much wrong with Slim 3; lots of people are using it very successfully producing APIs and websites of all kinds. For Slim 4 the main goals have been to support PSR-15, make it easier to use your own PSR-7 implementation, improve error handling and remove assumptions that look magical if y...

カテゴリー: php

Slim 4 Cyclomatic Complexity

planet PHP - 2019-04-03(水) 19:02:00

There's not much wrong with Slim 3; lots of people are using it very successfully producing APIs and websites of all kinds. For Slim 4 the main goals have been to support PSR-15, make it easier to use your own PSR-7 implementation, improve error handling and remove assumptions that look magical if you don't know they are there. The latter one is the most important to me, personally!

Secondarily, Pierre has concentrated on making Slim's code more flexible and hopefully making it easier to swap out our internal components with your own if you need to. On a whim, I ran phploc on the current Slim 3 and Slim 4-dev codebases to see what differences were. The full results are in this gist.

Note that Slim 4 doesn't have the PSR-7 implementation or the container wrapper, so it's maybe not possible to directly compare some of the numbers, but the cyclomatic complexity numbers are interesting and a direct outcome of Pierre's work:

Slim 3 Slim 4-dev Cyclomatic Complexity Average Complexity per LLOC 0.30 0.18 Average Complexity per Class 10.40 4.76 Minimum Class Complexity 1.00 1.00 Maximum Class Complexity 67.00 25.00 Average Complexity per Method 2.44 2.05 Minimum Method Complexity 1.00 1.00 Maximum Method Complexity 15.00 15.00

Cyclomatic complexity is a measure of the complexity of a codebase. It's really hard to ensure that a method with a high cyclomatic complexity works as intended and I'm delighted to see these numbers go down! Hopefully this means that Slim 4's internals are easier to understand and it will be easier to contribute to.

We need to find, assess and simplify the method that has that 15.00 though!

カテゴリー: php

Laravel News: PhpStorm 2019.1 Blade Debugging Support and a Laravel Code Style Preset

phpdeveloper.org - 2019-04-03(水) 04:00:02
JetBrains announced the release of PhpStorm 2019.1 this week with debugging support for Blade (and Twig) templates and a new predefined Laravel code style configuration. Visit Laravel News for the full post. The post PhpStorm 2019...
カテゴリー: php

Tomáš Votruba Blog: How to Mock Final Classes in PHPUnit

phpdeveloper.org - 2019-04-03(水) 01:30:01

Do you prefer composition over inheritance? Yes, that's great. Why aren't your classes final then? Oh, you have tests and you mock your classes. But why is that a problem?

カテゴリー: php

php|architect: Migrating Legacy Web Applications to Laravel

phpdeveloper.org - 2019-04-03(水) 00:34:10

By Barry O’Donovan Thanks to Taylor Otwell’s Laravel framework, PHP is reclaiming its rightful place as the go-to language for web application development. For those of us maintaining and developing applications using legacy frameworks, the grass certainly looks greener on Laravel’s ...

カテゴリー: php

Tomáš Votruba Blog: Removing Static - There and Back Again

phpdeveloper.org - 2019-04-03(水) 00:30:02

The more companies I meet, the more I see static and new everywhere. Not like new Product, but rather new ProductRepository(new Database()). Not just Laravel, but across all PHP frameworks. I wish frameworks could prevent antipatterns, but they don't, do they?

Instead of "refactor all the things" step by step, class by class, I'd like share my thoughts when exploring full automated path. I look for feedback to improve this process.

カテゴリー: php

PHP Podcasts: 145:Breakfast with a Listener

phpdeveloper.org - 2019-04-03(水) 00:03:26

This week, Eric, Thomas, and John discuss:

Laravel 5.8 update breaks third-party composer libraries · Issue #27949 · laravel/framework Unique Rule SQL Injection Warning - The Laravel Blog Be Careful: Laravel 5.8 Added bigIncrements As Defaults - Laravel Daily Security researchers reveal defects that allow wireless hijacking of giant construction cranes, scrapers and excavators

カテゴリー: php

418 I'm a teapot

planet PHP - 2019-04-03(水) 00:00:00

The IETF has a tradition to publish one or more april-fools RFC documents every year. Among the most famous are IP over Avian Carriers with Quality of Service, and of course Hyper Text Coffee Pot Control Protocol, which introduced the 418 I'm a teapot HTTP status.

This status-code is of course not an official one. You won’t find it in the IANA HTTP Status code registry. However, people have such a liking to it that it’s supported in many HTTP libraries.

About a year ago, the HTTP working group tried to reach out to various projects to try and remove their support for 418, so the number could be re-used for a new purpose, but this was met with a lot of resistance, even spawning https://save418.com.

Several implementations of HTCPCP can be found, including:

The 418 code also appears as easter eggs in numerous systems.

Wikipedia has a page on all the IETF april fools jokes, which is well worth a read. It also features the HTCPCP-TEA extension!

All we need now is a WHATWG living standard that just solidifies everyone’s buggy implementations (looking at you URL standard), and a W3C committee that forks it once per year.

References & sources
カテゴリー: php

Technical Thoughts, Tutorials, and Musings: PSR-14: Advanced Providers

phpdeveloper.org - 2019-04-02(火) 23:45:59

PSR-14: Advanced Providers

In part 3 of our series we looked at some common Provider patterns for PSR-14. But the flexibility and complexity of Providers is limited only by your imagination. Today we'll look at a few more interesting examples of Providers that are all equally valid but tailored to particular use cases.

カテゴリー: php

Interview with Olivia Liddell

planet PHP - 2019-04-02(火) 20:00:00

@oliravi Show Notes

Audio

This episode is sponsored by


The post Interview with Olivia Liddell appeared first on Voices of the ElePHPant.

カテゴリー: php

SymfonyCon Amsterdam 2019

php.net - 2019-04-02(火) 19:28:14

Symfony is proud to organize the seventh edition of the SymfonyCon, the international Symfony conference. This year, we decided to bring the entire community to the Netherlands and discover the amazing city of Amsterdam. If you like Symfony and share fun with professionals, this is where you want to be on November!

We look forward to welcoming you to Amsterdam, capital of the Netherlands. Join us for talks, workshops, discussions and other serious work around Symfony and its environment. And of course, celebrate the community reunion!

SymfonyCon Amsterdam is a 5-day event from November 19th to November 23rd:

Two-day workshop: Tuesday, November 19th and Wednesday, November 20th

Two-day conference: Thursday, November 21st and Friday, November 22nd

One hackday: Saturday, November 23rd

カテゴリー: php

SymfonyLive Berlin 2019

php.net - 2019-04-02(火) 19:24:43
カテゴリー: php

SymfonyLive London 2019

php.net - 2019-04-02(火) 19:23:10
カテゴリー: php

SymfonyLive Warszawa 2019

php.net - 2019-04-02(火) 19:21:12
カテゴリー: php

SymfonyLive São Paulo 2019

php.net - 2019-04-02(火) 19:13:07
カテゴリー: php

SymfonyLive Tunis 2019

php.net - 2019-04-02(火) 19:03:21
カテゴリー: php

ページ