Rule | Namespace | Description |
---|---|---|
Arrays.ArrayBracketSpacing | /Squiz.Arrays.ArrayBracketSpacing | Ensure that there are no spaces around square brackets. |
Arrays.ArrayDeclaration | /Squiz.Arrays.ArrayDeclaration | Ensures that arrays conform to the array coding standard. |
Arrays.DisallowLongArraySyntax | /Generic.Arrays.DisallowLongArraySyntax | Bans the use of the PHP long array syntax. |
Arrays.DisallowShortArraySyntax | /Generic.Arrays.DisallowShortArraySyntax | Bans the use of the PHP short array syntax. |
CSS.BrowserSpecificStyles | /MySource.CSS.BrowserSpecificStyles | Ensure that browser-specific styles are not used. |
CSS.ClassDefinitionClosingBraceSpace | /Squiz.CSS.ClassDefinitionClosingBraceSpace | Ensure there is a single blank line after the closing brace of a class definition. |
CSS.ClassDefinitionNameSpacing | /Squiz.CSS.ClassDefinitionNameSpacing | Ensure there are no blank lines between the names of classes/IDs. |
CSS.ClassDefinitionOpeningBrace |
This file contains 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 | |
// composing presenters without inheritance | |
// (requires nette/application 2.4.11) | |
trait RequireLoggedUser | |
{ | |
public function injectRequireLoggedUser() | |
{ |
This file contains 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 | |
declare(strict_types=1); | |
require '/nette.phar'; | |
class TypeHints | |
{ | |
public $php71 = true; |
This is side-document providing details for some highlighted changes in 2.5.0. For a full list of changes, see the full release note.
This file contains 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
FROM php:7.1-fpm-alpine | |
RUN apk add --update \ | |
autoconf \ | |
g++ \ | |
libtool \ | |
make \ | |
&& docker-php-ext-install mbstring \ | |
&& docker-php-ext-install mysqli \ |
This file contains 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
'use strict' | |
const timeout = ms => new Promise(res => setTimeout(res, ms)) | |
function convinceMe (convince) { | |
let unixTime = Math.round(+new Date() / 1000) | |
console.log(`Delay ${convince} at ${unixTime}`) | |
} | |
async function delay () { |
This file contains 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
#!/usr/bin/php | |
<?php | |
$input = file_get_contents('php://stdin'); | |
preg_match('|^To: (.*)|', $input, $matches); | |
$filename = tempnam('/var/log/mail', $matches[1] . '.'); | |
file_put_contents($filename, $input); |
This file contains 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
# ------------------------------------ | |
# Docker alias and function | |
# ------------------------------------ | |
# Get latest container ID | |
alias dl="docker ps -l -q" | |
# Get container process | |
alias dps="docker ps" |
- For your local dev, create a
Dockerfile
that is based on your production image and simply installxdebug
into it. Exemple:
FROM php:5
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
NewerOlder