This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Single Responsibility Principle in PHP | |
* | |
* Each class should be stored in a folder called Services/User/*. | |
*/ | |
// Located in Services/User/UserAuthenticatorService.php | |
class UserAuthenticatorService | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Liskov’s Substitution Principle (LSP) in PHP (not working) | |
*/ | |
abstract class CMS | |
{ | |
abstract public function findArticles(int $limit); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WP Show enqueued assets | |
* Description: Show all enqueued assets (scripts & styles) in backend/frontend comments. | |
* Version: 0.0.1 | |
* Requires at least: 5.2 | |
* Requires PHP: 7.0 | |
* Author: Alex so yes | |
* Author URI: https://alexsoyes.com | |
* License: GPL v2 or later |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_deregister_scripts() | |
{ | |
wp_dequeue_script( 'wp-embed' ); | |
} | |
add_action( 'wp_footer', 'my_deregister_scripts' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_deregister_scripts() | |
{ | |
wp_dequeue_style( 'wp-block-library' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_deregister_scripts' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$students = [ | |
[ | |
'firstname' => 'Alex', | |
'age' => 27, | |
], | |
[ | |
'firstname' => 'Bastien', | |
'age' => 19, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$students = [ | |
[ | |
'firstname' => 'Alex', | |
'age' => 27, | |
], | |
[ | |
'firstname' => 'Bastien', | |
'age' => 19, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$students = [ | |
[ | |
'firstname' => 'Alex', | |
'age' => 27, | |
], | |
[ | |
'firstname' => 'Bastien', | |
'age' => 19, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$students = [ | |
[ | |
'firstname' => 'Alex', | |
'age' => 27, | |
], | |
[ | |
'firstname' => 'Bastien', | |
'age' => 19, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Vous avez deux manières de mettre des commentaires. | |
// Celle-ci permet de mettre de petit commentaire quand c'est nécessaire. | |
/** | |
* Et voici la seconde, on l'utilise surtout pour les fonctions et l'utilisation d'annotations ! | |
*/ | |
/** |