class Webikon_PlatobneBrany_Payment_Gateway extends PaymentFramework {
public function pay( $order ) {
...
}
}
namespace Webikon\PlatobneBrany;
class Payment_Gateway extends PaymentFramework {
public function pay( \WC_Order $order ): ?Payment {
...
}
}
class New_Controller extends Legacy_Controller_Class {
public function __construct ( Collection $collection ) {
...
}
}
class_alias( 'Legacy_Controller_Class', 'Standard_Controller' );
class New_Controller extends Standard_Controller {
public function __construct ( Collection $collection ) {
...
}
}
// Core
function wp_insert_post( array $postarr, bool $wp_error = false ) {}
function back_to_future( string $old, string $new, \Bang $object ) {}
public static function instance(): ?Collection {
return new Collection();
}
class WordPress extends Code {
public $people;
public function set_people( array $people ) {
$this->people = $people;
}
public function __constructor( array $people ) {
$this->set_people( $people );
}
}
class WordCamp extends Community {
public $people;
public function set_people( array $people ) {
$this->people = $people;
}
public function __constructor( array $people ) {
$this->set_people( $people );
}
}
trait People {
public $people:
public function set_people( array $people ) {
$this->people = $people;
}
}
class WordPress extends Code {
use People;
public function __constructor( array $people ) {
$this->set_people( $people );
}
}
class WordCamp extends Community {
use People;
public function __constructor( array $people ) {
$this->set_people( $people );
}
}
vs.
{
"repositories":[
{
"type":"composer",
"url":"https://wpackagist.org"
}
],
"require": {
"aws/aws-sdk-php":"*",
"wpackagist-plugin/wordpress-seo":">=7.0.2",
}
}
{
"require": {
"php": ">=7.2.0",
"nothingworks/blade-svg": "v0.3.1",
"woocommerce/woocommerce": "3.6.5",
"wpackagist-theme/hueman":"*"
...
},
"require-dev": {
"phpro/grumphp": "0.15.2",
"phpunit/phpunit": "^7.0",
"squizlabs/php_codesniffer": "3.4.2",
"wp-cli/wp-cli-bundle": "2.3"
...
}
}
https://github.com/mattstauffer/Torch
// Create new writer instance with dependencies
$log = new Illuminate\Log\Logger(
new Monolog\Logger('Custom Logger')
);
// Setup log file location
$log->pushHandler(
new Monolog\Handler\StreamHandler('./logs/app.log')
);
// Actual log(s)
$log->info('Logging an info message');
$log->error('Logging an error message');
$log->notice('Logging a notice message');
use Symfony\Component\Yaml\Yaml;
$value = Yaml::parseFile('/path/to/file.yaml');
{
"devDependencies": {
"browser-sync": "^2.26.7",
"laravel-mix": "^4.1.2",
"sass": "^1.17.3",
...
},
"dependencies": {
"bootstrap": "4.3.1",
"choices.js": "^6.0.3",
"jquery": "^3.4.0",
"popper.js": "^1.14.6",
...
}
}
Route::get()
->url( '/custom' )
->query( function ( $query_vars ) {
return [
// WP_Query query vars go here ...
];
} )
->middleware( ['user.can:manage_options', 'minify'] )
->handle( 'CustomController@custom' );
View::addComposer( 'templates/about-us', function( $view ) {
$view->with( ['hello' => 'world'] );
} );
<html>
<head>
<title>Site Name - @yield('title')</title>
</head>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@yield('content')
</div>
</body>
</html>
https://github.com/corcel/corcel
// Get 3 posts with custom post type (store) and show its address
$stores = Post::type('store')->status('publish')->take(3)->get();
// Find a published post which matches both meta_key and meta_value.
$post = Post::published()->hasMeta('username', 'Janko')->first();
// only all categories and posts connected with it
$cat = Taxonomy::where('taxonomy', 'category')->with('posts')->get();
there're reasons not to use
WordPress