These things are "blocks" of code, always on their own lines because they are always by themselves.
<?php
class Foo
{
public function doSomeShit()
{
This is a list of issues or discrepencies between the wording or intention of PSR-2 itself and the CodeSniffer PSR-2 ruleset.
Add suggestions in the comments or tweet me (@philsturgeon) if you have more inconsistencies to report.
{ | |
"require": { | |
"laravel/framework": "4.0.*", | |
}, | |
"require-dev": { | |
"behat/behat": "2.4.*", | |
"mockery/mockery": "0.7.*", | |
"fzaninotto/Faker": "1.2.*", | |
"pdepend/pdepend" : "1.1.*", |
$1 - That warm fuzzy feeling of being a good person
$5 - A thank you tweet praising your or your company
$10 - Any one of the following:
[2013-06-25T15:50:22+00:00] INFO: Processing template[/etc/sudoers] action create (sudo::default line 41) | |
[2013-06-25T15:50:22+00:00] INFO: Processing execute[apt-get-update] action run (apt::default line 22) | |
[2013-06-25T15:50:22+00:00] INFO: Processing execute[apt-get update] action nothing (apt::default line 29) | |
[2013-06-25T15:50:22+00:00] INFO: Processing package[update-notifier-common] action install (apt::default line 36) | |
[2013-06-25T15:50:22+00:00] INFO: Processing execute[apt-get-update-periodic] action run (apt::default line 40) | |
[2013-06-25T15:50:22+00:00] INFO: Processing directory[/var/cache/local] action create (apt::default line 50) | |
[2013-06-25T15:50:22+00:00] INFO: Processing directory[/var/cache/local/preseeding] action create (apt::default line 50) | |
[2013-06-25T15:50:22+00:00] INFO: Processing package[git] action install (git::default line 24) | |
[2013-06-25T15:50:22+00:00] INFO: Processing package[build-essential] action install (build-essential::default line 48) | |
[2013-06-25T15:50:22+00:00] INFO: |
A native implementation of PSR-0 using only the autoloader from the PSR-0 example in the spec would expect a folder structure like this:
League\Oauth2\Client\Foo = myapp/somefolder/League/Oauth2/Client/Foo.php
League\Oauth2\Server\Bar = myapp/somefolder/League/Oauth2/Server/Bar.php
If I was making these as packages, I could make them into two packages, which would be installed in different locations, because thats how Composer rolls:
League\Oauth2\Client\Foo = myapp/vendor/league/oauth2/src/League/Oauth2/Client/Foo.php
League\Oauth2\Server\Bar = myapp/vendor/league/oauth2-server/src/League/Oauth2/Server/Bar.php
false
as "0"
, so you want to typecast them.$hidden
array then OOPS!/users/id/5/active/true
. Your API does not need to be SEO optimised.?format=xml
is stupid, use an Accept: application/xml
header. I added this to the CodeIgniter Rest Server once for lazy people, and now people think it's a thing. It's not.function autoload($className) | |
{ | |
if (file_exists('autoload.php')) { | |
require_once('autoload.php'); | |
return; | |
} | |
$className = ltrim($className, '\\'); | |
$fileName = ''; | |
$namespace = ''; | |
if ($lastNsPos = strrpos($className, '\\')) { |
from apns import APNs, Payload, PayloadAlert | |
import time | |
tokens = [u'tokenhexabcdef0123456789'] | |
apns = APNs(use_sandbox=True, cert_file='client.pem', key_file='key.pem') | |
alert = PayloadAlert("", loc_key="FOO", loc_args=['Some Guy']) | |
payload = Payload(alert=alert, sound="default", badge=1) | |
for token in tokens: |
<?php | |
$users = [['id' => 1, 'name' => 'Jack'], ['id' => 2, 'name' => 'Jill']]; | |
echo implode(',', array_map(function($u) { return "'{$u['id']}'"; }, $users)); |