Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!

Archive for Luty, 2017

Full Stack Radio: 59: Jonathan Reinink – Form Hell Part 2: Complex Validation

Full Stack Radio: 59: Jonathan Reinink – Form Hell Part 2: Complex Validation

On the Full Stack Radio podcast host Adam Wathan is joined once again by Jonathan Reinink to follow up their previous show and talk more about complex validation.

In this episode, Adam and Jonathan continue their discussion about forms from episode 54, this time focusing on the complexities of validation.

Topics mentioned include form requests in Laravel, a forum post about a possible bypass of CVC and ZIP checks with Stripe and HTML5 form validation. You can listen to this latest show either through the in-page audio player or by downloading the mp3 directly. If you enjoy the episode, be sure to subscribe to their feed and follow them on Twitter for updates on when new shows are released.

Source: http://www.phpdeveloper.org/news/24943

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Community News: Latest PEAR Releases (02.27.2017)

Community News: Latest PEAR Releases (02.27.2017)

Latest PEAR Releases:

Source: http://www.phpdeveloper.org/news/24942

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Community News: Latest PEAR Releases (02.27.2017)

Community News: Latest PEAR Releases (02.27.2017)

Latest PEAR Releases:

Source: http://www.phpdeveloper.org/news/24942

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Weebly Engineering Blog: PHPUnit – Mocking the Filesystem with vfsStream

Weebly Engineering Blog: PHPUnit – Mocking the Filesystem with vfsStream

On the Weebly Engineering blog there’s a new post showing you how to combine PHPUnit and vfsStream to mock out file system operations away from the actual file system.

Recently I found myself needing to write tests for a small class that read from a json file. The class needed to read a json file, validate its existence and content, provide a method to inform the user if a certain key exists, and provide a method to retrieve a value for a given key.

[...] Testing this class in isolation can be tricky because it currently has a dependency on the file system. Storing test json files to test this class would work, but is not ideal because it leaves a dependency on the file system in your tests. As with any external resource, there might be intermittent problems with the file system and could result in some flaky tests. This is where vfsStream shines.

The post includes an example class under test that pulls in the JSON files and operates on the contents. To make the testing easier they introduce vfsStream, a wrapper that allows for a virtual "file system" that can be operated on through the usual interfaces. They include an example of its use in a test on the same class making it easier to check the JSON based on a pre-defined value (essentially a mock of the file and its contents).

Source: http://www.phpdeveloper.org/news/24941

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Weebly Engineering Blog: PHPUnit – Mocking the Filesystem with vfsStream

Weebly Engineering Blog: PHPUnit – Mocking the Filesystem with vfsStream

On the Weebly Engineering blog there’s a new post showing you how to combine PHPUnit and vfsStream to mock out file system operations away from the actual file system.

Recently I found myself needing to write tests for a small class that read from a json file. The class needed to read a json file, validate its existence and content, provide a method to inform the user if a certain key exists, and provide a method to retrieve a value for a given key.

[...] Testing this class in isolation can be tricky because it currently has a dependency on the file system. Storing test json files to test this class would work, but is not ideal because it leaves a dependency on the file system in your tests. As with any external resource, there might be intermittent problems with the file system and could result in some flaky tests. This is where vfsStream shines.

The post includes an example class under test that pulls in the JSON files and operates on the contents. To make the testing easier they introduce vfsStream, a wrapper that allows for a virtual "file system" that can be operated on through the usual interfaces. They include an example of its use in a test on the same class making it easier to check the JSON based on a pre-defined value (essentially a mock of the file and its contents).

Source: http://www.phpdeveloper.org/news/24941

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Jef Claes: How to organize a meetup

Jef Claes: How to organize a meetup

If you’ve ever been interested in starting a technology-centric meetup in your area but haven’t known where to start, Jef Claes has some helpful hints to help you get started.

I’ve organized a few DDDBE meetups in the past, and always succeed in forgetting something. Either someone points it out well in advance, or I end up stressing last minute. This post partly serves as a checklist for myself, but it would be a welcome side effect to also see it encourage others to help out organizing future meetups. Organizing a meetup is not rocket science, having a list of what to take care of is a good start.

He breaks down the recommendations into a list of ten things to do to make a successful meetup happen:

  • Contacting a speaker
  • Gathering speaker requirements
  • Selecting a location sponsor
  • Contacting a location sponsor
  • Meetup.com
  • Speaker gift
  • Recordings
  • Day of the meetup
  • Give thanks

While ten steps sounds like a lot, some of these are optional (like the speaker gift) but they can help to build a good reputation for the group and make it easier to find future speakers.

Source: http://www.phpdeveloper.org/news/24940

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Jef Claes: How to organize a meetup

Jef Claes: How to organize a meetup

If you’ve ever been interested in starting a technology-centric meetup in your area but haven’t known where to start, Jef Claes has some helpful hints to help you get started.

I’ve organized a few DDDBE meetups in the past, and always succeed in forgetting something. Either someone points it out well in advance, or I end up stressing last minute. This post partly serves as a checklist for myself, but it would be a welcome side effect to also see it encourage others to help out organizing future meetups. Organizing a meetup is not rocket science, having a list of what to take care of is a good start.

He breaks down the recommendations into a list of ten things to do to make a successful meetup happen:

  • Contacting a speaker
  • Gathering speaker requirements
  • Selecting a location sponsor
  • Contacting a location sponsor
  • Meetup.com
  • Speaker gift
  • Recordings
  • Day of the meetup
  • Give thanks

While ten steps sounds like a lot, some of these are optional (like the speaker gift) but they can help to build a good reputation for the group and make it easier to find future speakers.

Source: http://www.phpdeveloper.org/news/24940

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Jef Claes: How to organize a meetup

Jef Claes: How to organize a meetup

If you’ve ever been interested in starting a technology-centric meetup in your area but haven’t known where to start, Jef Claes has some helpful hints to help you get started.

I’ve organized a few DDDBE meetups in the past, and always succeed in forgetting something. Either someone points it out well in advance, or I end up stressing last minute. This post partly serves as a checklist for myself, but it would be a welcome side effect to also see it encourage others to help out organizing future meetups. Organizing a meetup is not rocket science, having a list of what to take care of is a good start.

He breaks down the recommendations into a list of ten things to do to make a successful meetup happen:

  • Contacting a speaker
  • Gathering speaker requirements
  • Selecting a location sponsor
  • Contacting a location sponsor
  • Meetup.com
  • Speaker gift
  • Recordings
  • Day of the meetup
  • Give thanks

While ten steps sounds like a lot, some of these are optional (like the speaker gift) but they can help to build a good reputation for the group and make it easier to find future speakers.

Source: http://www.phpdeveloper.org/news/24940

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Site News: Popular Posts for This Week (02.24.2017)

Site News: Popular Posts for This Week (02.24.2017)

Popular posts from PHPDeveloper.org for the past week:

Source: http://www.phpdeveloper.org/news/24939

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Ian Cambridge: Code Review: Single Responsibility Principle

Ian Cambridge: Code Review: Single Responsibility Principle

Ian Cambridge has put together a new post for his site focusing on the Single Responsibility Principle, one of the more well-known (and well understood) parts of the SOLID design principles.

Single Responsibility Principle (SRP) is probably one of the most well-known principles from SOLID. At its core is a desire to prevent classes from becoming overwhelming and bloated. While enabling the ability to change how a single thing works by only changing a single class. So the benefits of SRP are that you have an easier codebase to maintain since classes are less complex and when you wish to change something you only have to change a single class. In this blog, I will go through some ways to try and help avoid breaching SRP while doing code review.

He gives two examples and the code they might contain, breaking the SRP mentality. The first is a "manager" (or service) class that, while good in principle, usually ends up performing way too many operations than it should. The second is a "from usage" instance where the return of one method is being used as a parameter for another method in the same class. For each he talks about the problem with the current implementation and offers a suggestion or two of things to fix to make it adhere more to SRP ideals.

Source: http://www.phpdeveloper.org/news/24938

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>