Skip to content

Commit

Permalink
Some preparations and minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FaaPz committed May 29, 2016
1 parent 6d6f9cd commit 766c30b
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ $RECYCLE.BIN/
# ---- Development Files ----
# ---------------------------

.php_cs.cache
composer.lock
composer.phar
vendor/
Expand Down
16 changes: 13 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "slim/pdo",
"description": "PDO database library for Slim Framework",
"version": "1.9.8",
"version": "2.0.0-dev",
"type": "library",
"keywords": ["pdo", "database", "slim", "framework"],
"homepage": "https://github.com/FaaPz/Slim-PDO",
Expand All @@ -19,12 +19,22 @@
"docs": "https://github.com/FaaPz/Slim-PDO/blob/master/docs/README.md"
},
"require": {
"php": ">=5.3.0",
"php": ">=5.6.0",
"ext-pdo": "*"
},
"require-dev": {
"phpunit/phpunit": "~5.3",
"phake/phake": "~2.0"
},
"autoload": {
"psr-4": {
"Slim\\PDO\\": "src/PDO/"
}
}
},
"autoload-dev": {
"psr-4": {
"Slim\\PDO\\Test\\": "tests"
}
},
"minimum-stability": "stable"
}
7 changes: 2 additions & 5 deletions src/PDO/Clause/WhereClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ class WhereClause extends ClauseContainer
*/
public function where($column, $operator = null, $chainType = 'AND')
{
if ($column instanceof StatementCombination)
{
if ($column instanceof StatementCombination) {
$this->container[] = ' '.$chainType.' '.$column;
}
else
{
} else {
$this->container[] = ' '.$chainType.' '.$column.' '.$operator.' ?';
}
}
Expand Down
16 changes: 16 additions & 0 deletions src/PDO/Exception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

/**
* @license MIT
* @license http://opensource.org/licenses/MIT
*/
namespace Slim\PDO;

/**
* Class Exception.
*
* @author Fabian de Laender <[email protected]>
*/
class Exception extends \PDOException
{
}
5 changes: 3 additions & 2 deletions src/PDO/Statement/SelectStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,10 @@ protected function setDistinct($distinct)
*/
protected function setAs($alias)
{
$sql = "";
$sql = '';

if (! empty($alias)) {
$sq1 = "AS {$alias}";
$sql = "AS {$alias}";
}

return $sql;
Expand Down
7 changes: 2 additions & 5 deletions src/PDO/Statement/StatementContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,9 @@ public function __construct(Database $dbh)
*/
public function where($column, $operator = null, $value = null, $chainType = 'AND')
{
if ($column instanceof StatementCombination)
{
if ($column instanceof StatementCombination) {
$this->setValues($column->values);
}
else
{
} else {
$this->values[] = $value;
}

Expand Down
6 changes: 2 additions & 4 deletions src/PDO/Statement/StatementInterface.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php
/**
* Created by PhpStorm.
* User: abarker
* Date: 2/2/16
* Time: 4:14 PM
* @license MIT
* @license http://opensource.org/licenses/MIT
*/

namespace Slim\PDO\Statement;
Expand Down
Empty file added tests/.gitkeep
Empty file.

0 comments on commit 766c30b

Please sign in to comment.