Good:
interface MyInterface
{
function foo();
}
class MyClass implements MyInterface
{
fos_user: | |
db_driver: orm | |
firewall_name: main | |
user_class: App\Entity\User | |
service: | |
user_manager: app.user_manager | |
hwi_oauth: | |
firewall_name: main | |
fosub: |
var express = require('express'); | |
var app = express(); | |
app.get('/', function (req, res) { | |
res.send('Hello World!'); | |
}); | |
app.listen(3000, function () { | |
console.log('Running on port 3000.'); | |
}); |
diff --git a/lib/Github/Api/Repository/Assets.php b/lib/Github/Api/Repository/Assets.php | |
index ad48aaf..cee57d5 100644 | |
--- a/lib/Github/Api/Repository/Assets.php | |
+++ b/lib/Github/Api/Repository/Assets.php | |
@@ -74,7 +74,6 @@ class Assets extends AbstractApi | |
} | |
$name = $params['name']; | |
- $parameters['body'] = $params['body']; | |
$headers['Content-Type'] = $params['content-type']; |
Good:
interface MyInterface
{
function foo();
}
class MyClass implements MyInterface
{
<?php | |
`apt-get update && sudo apt-get upgrade && apt-get install nginx php5-fpm -y`; | |
$nginx = <<<TEXT | |
user www-data; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { |
user www-data; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 768; | |
} | |
http { | |
sendfile on; |
Bad:
<div class="comment">
<div class="message">some message</div>
<div class="rate {% if comment.rate > 0%}green{% elseif comment.rate < 0 %}red{% else %}gray{% endif %}">{{ comment.rate }}</div>
</div>
Good:
$('textarea').bind('click', function(){ | |
var currentChar = $(this)[0].selectionEnd; | |
var all = $(this)[0].textLength; | |
var line = 0; | |
for (i = 0; i <= all; i++) { | |
var char = $(this).text()[i]; | |
if (char == "\n") { | |
line++; |
<?php | |
if ( | |
!$this->isOauthExists() | |
&& ('oauth' === $driver | |
|| (isset($fetcherConfig['options']['method']) && 'oauth' === $fetcherConfig['options']['method'])) | |
) { | |
throw new \InvalidArgumentException('You should install and enable InoriTwitterBundle'); | |
} |
<?php | |
namespace Knp\Bundle\LastTweetsBundle\Tests\Twitter\LastTweetsFetcher; | |
use Knp\Bundle\LastTweetsBundle\Twitter\LastTweetsFetcher\ApiFetcher; | |
use Knp\Bundle\LastTweetsBundle\Twitter\Tweet; | |
class ApiFetcherTest extends \PHPUnit_Framework_TestCase | |
{ | |
const CLASSNAME = 'Knp\Bundle\LastTweetsBundle\Twitter\LastTweetsFetcher\ApiFetcher'; |