add php-cs-fixer to travis

enable test 1 and 2.
test 3 does not seem to pass
This commit is contained in:
Ryan Rushton 2015-03-19 23:11:44 -07:00
parent 9cea8e3007
commit 239b3678ae
5 changed files with 17 additions and 9 deletions

View File

@ -31,6 +31,8 @@ before_install:
# Java, C, C++, C#, Objective-C, D, Pawn, Vala
- brew install uncrustify
# PHP
# - pear install PHP_Beautifier-beta
- wget http://get.sensiolabs.org/php-cs-fixer.phar
- mv php-cs-fixer.phar /usr/local/bin/php-cs-fixer
- chmod a+x /usr/local/bin/php-cs-fixer
# CoffeeScript
- npm install coffee-formatter

View File

@ -1,25 +1,30 @@
<?php
$hello = "world";
if (!isset($_SESSION)) session_start();
require_once ("sql.req.php");
if (!isset($_SESSION)) {
session_start();
}
require_once "sql.req.php";
// friend requests
$q = $mysqli->query("");
$num = $q->num_rows;
echo '<a href="notifications.php">';
if ($num > 0) {
if ($num>0) {
echo '<i class="fa fa-star white"></i>';
} else {
echo '<i class="fa fa-star-o"></i>';
}
echo '</a>';
// new messages
$q = $mysqli->query("");
$num = $q->num_rows;
echo '<a href="messages.php">';
if ($num > 0) {
if ($num>0) {
echo '<i class="fa fa-envelope white"></i>';
} else {
echo '<i class="fa fa-envelope-o"></i>';
}
echo '</a>';
?>

View File

@ -1,5 +1,6 @@
<?php
function add($a, $b) {
return $a + $b;
function add($a, $b)
{
return $a +$b;
}
echo add(1, 2);
echo add(1, 2);