Skip to content

Commit b5b6f3b

Browse files
author
Afonso Gloeden
committed
Annotations updated
1 parent 0026b88 commit b5b6f3b

File tree

4 files changed

+85
-15
lines changed

4 files changed

+85
-15
lines changed

src/Database/Connection.php

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ protected function getDoctrineDriver()
109109
return new DoctrineDriver;
110110
}
111111

112+
/**
113+
* Compile for select.
114+
*
115+
* @param \Illuminate\Database\Query\Builder $builder
116+
* @param array $bindings
117+
* @return array
118+
*/
112119
private function compileForSelect(Builder $builder, $bindings) {
113120
$arrTables = [];
114121
array_push($arrTables, $builder->from);
@@ -221,6 +228,12 @@ private function compileForSelect(Builder $builder, $bindings) {
221228
return $newBinds;
222229
}
223230

231+
/**
232+
* Query string for select.
233+
*
234+
* @param string $tables
235+
* @return string
236+
*/
224237
private function queryStringForSelect($tables)
225238
{
226239
$explicitDB = explode('..', $tables);
@@ -281,8 +294,8 @@ private function queryStringForSelect($tables)
281294
* Set new bindings with specified column types to Sybase.
282295
*
283296
* @param string $query
284-
* @param array $bindings
285-
* @return mixed $newBinds
297+
* @param array $bindings
298+
* @return mixed $newBinds
286299
*/
287300
private function compileBindings($query, $bindings)
288301
{
@@ -413,6 +426,12 @@ private function compileBindings($query, $bindings)
413426
return $newBinds;
414427
}
415428

429+
/**
430+
* Query string for compile bindings.
431+
*
432+
* @param string $table
433+
* @return string
434+
*/
416435
private function queryStringForCompileBindings($table)
417436
{
418437
$explicitDB = explode('..', $table);
@@ -471,11 +490,11 @@ private function queryStringForCompileBindings($table)
471490

472491
/**
473492
* Set new bindings with specified column types to Sybase.
474-
* Poderia compilar novamente dos bindings usando os PDO::PARAM, porém,
475-
* não tem nenhuma constante que lide com decimais, logo, a única maneira
476-
* seria colocando PDO::PARAM_STR, que colocaria plicas.
477-
* Detalhes:
478-
* http://stackoverflow.com/questions/2718628/pdoparam-for-type-decimal
493+
*
494+
* It could compile again from bindings using PDO::PARAM, however, it has
495+
* no constants that deal with decimals, so the only way would be to put
496+
* PDO::PARAM_STR, which would put quotes.
497+
* @link http://stackoverflow.com/questions/2718628/pdoparam-for-type-decimal
479498
*
480499
* @param string $query
481500
* @param array $bindings
@@ -505,6 +524,15 @@ private function compileNewQuery($query, $bindings)
505524
return $newQuery;
506525
}
507526

527+
/**
528+
* Compile offset.
529+
*
530+
* @param int $offset
531+
* @param string $query
532+
* @param array $bindings
533+
* @param \Uepg\LaravelSybase\Database\Connection $me
534+
* @return string
535+
*/
508536
public function compileOffset($offset, $query, $bindings = [], $me)
509537
{
510538
$limit = $this->queryGrammar->getBuilder()->limit;
@@ -566,6 +594,12 @@ public function compileOffset($offset, $query, $bindings = [], $me)
566594
}
567595
}
568596

597+
/**
598+
* Query string for identity.
599+
*
600+
* @param string $from
601+
* @return string
602+
*/
569603
private function queryStringForIdentity($from)
570604
{
571605
$explicitDB = explode('..', $from);
@@ -594,6 +628,12 @@ private function queryStringForIdentity($from)
594628
}
595629
}
596630

631+
/**
632+
* Query string for primaries.
633+
*
634+
* @param string $from
635+
* @return string
636+
*/
597637
private function queryStringForPrimaries($from)
598638
{
599639
$explicitDB = explode('..', $from);
@@ -671,8 +711,10 @@ public function select($query, $bindings = [], $useReadPdo = true)
671711
}
672712

673713
/**
714+
* Get the statement.
715+
*
674716
* @param string $query
675-
* @param mixed array $bindings
717+
* @param mixed|array $bindings
676718
* @return bool
677719
*/
678720
public function statement($query, $bindings = [])
@@ -688,6 +730,13 @@ public function statement($query, $bindings = [])
688730
});
689731
}
690732

733+
/**
734+
* Affecting statement.
735+
*
736+
* @param string $query
737+
* @param array $bindings
738+
* @return int
739+
*/
691740
public function affectingStatement($query, $bindings = [])
692741
{
693742
return $this->run($query, $bindings, function ($query, $bindings) {
@@ -712,7 +761,9 @@ public function getFetchMode()
712761
}
713762

714763
/**
715-
* @return \Uepg\LaravelSybase\Database\Query\Builder
764+
* Get SchemaBuilder.
765+
*
766+
* @return \Illuminate\Database\Query\Builder
716767
*/
717768
public function getSchemaBuilder()
718769
{

src/Database/Query/Grammar.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,26 @@ class Grammar extends IlluminateGrammar
1818
'&', '&=', '|', '|=', '^', '^=',
1919
];
2020

21+
/**
22+
* Builder for query.
23+
*
24+
* @var \Illuminate\Database\Query\Builder
25+
*/
2126
protected $builder;
2227

28+
/**
29+
* Get the builder.
30+
*
31+
* @return \Illuminate\Database\Query\Builder
32+
*/
2333
public function getBuilder(){
2434
return $this->builder;
2535
}
2636

2737
/**
2838
* Compile a select query into SQL.
2939
*
30-
* @param \Uepg\LaravelSybase\Database\Query\Builder
40+
* @param \Illuminate\Database\Query\Builder $query
3141
* @return string
3242
*/
3343
public function compileSelect(Builder $query)
@@ -41,7 +51,7 @@ public function compileSelect(Builder $query)
4151
/**
4252
* Compile the "select *" portion of the query.
4353
*
44-
* @param \Uepg\LaravelSybase\Database\Query\Builder $query
54+
* @param \Illuminate\Database\Query\Builder $query
4555
* @param array $columns
4656
* @return string
4757
*/
@@ -67,7 +77,7 @@ protected function compileColumns(Builder $query, $columns)
6777
/**
6878
* Compile the "from" portion of the query.
6979
*
70-
* @param \Uepg\LaravelSybase\Database\Query\Builder $query
80+
* @param \Illuminate\Database\Query\Builder $query
7181
* @param string $table
7282
* @return string
7383
*/
@@ -90,7 +100,7 @@ protected function compileFrom(Builder $query, $table)
90100
/**
91101
* Compile the "limit" portions of the query.
92102
*
93-
* @param \Uepg\LaravelSybase\Database\Query\Builder $query
103+
* @param \Illuminate\Database\Query\Builder $query
94104
* @param int $limit
95105
* @return string
96106
*/
@@ -102,7 +112,7 @@ protected function compileLimit(Builder $query, $limit)
102112
/**
103113
* Compile the "offset" portions of the query.
104114
*
105-
* @param \Uepg\LaravelSybase\Database\Query\Builder $query
115+
* @param \Illuminate\Database\Query\Builder $query
106116
* @param int $offset
107117
* @return string
108118
*/
@@ -114,7 +124,7 @@ protected function compileOffset(Builder $query, $offset)
114124
/**
115125
* Compile a truncate table statement into SQL.
116126
*
117-
* @param \Uepg\LaravelSybase\Database\Query\Builder $query
127+
* @param \Illuminate\Database\Query\Builder $query
118128
* @return array
119129
*/
120130
public function compileTruncate(Builder $query)

src/Database/Schema/Blueprint.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
class Blueprint extends IlluminateBlueprint
88
{
9+
/**
10+
* Function for numeric type.
11+
*
12+
* @param string $type
13+
* @param string $name
14+
* @param array $parameters
15+
* @return \Illuminate\Database\Schema\ColumnDefinition
16+
*/
917
public function numeric($column, $total = 8, $autoIncrement = false)
1018
{
1119
return $this->addColumn(

src/Database/Schema/Grammar.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class Grammar extends IlluminateGrammar
3333
/**
3434
* Verify if $str length is lower to 30 characters.
3535
*
36+
* @param string $str
3637
* @return string
3738
*/
3839
public function limit30Characters($str)

0 commit comments

Comments
 (0)