1. Go to this page and download the library: Download ahmedzidan/php-core library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ahmedzidan / php-core example snippets
final class ValueObject {
private $value;
public function __construct($value) {
$this->value = $value;
}
}
final class URI {
use Fleshgrinder\Core\Uncloneable;
// ...
public function withFragment(string $fragment): URI {
$clone = clone $this;
$clone->fragment = $fragment;
return $clone;
}
}
abstract class EntityFriend {
use Fleshgrinder\Core\Uncloneable;
protected $value;
protected function setValue(T $value): void {
$this->value = $value;
}
}
final class Entity extends EntityFriend {
public function getValue(): T {
return $this->value;
}
}
final class EntityBuilder extends EntityFriend {
private $entity;
public function __construct() {
$this->entity = new Entity;
}
public function build(): Entity {
return clone $this->entity;
}
public function setValue(T $value): void {
$this->entity->setValue($value);
}
}
final class SomeClass {
use Fleshgrinder\Core\Unconstructable;
public static function new(): self {
return new static;
}
}
final class AbstractFinalClass {
use Fleshgrinder\Core\Unconstructable;
public static function f() { }
public static function f′() { }
// ...
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.