-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
101 changed files
with
4,257 additions
and
1,406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
$rules = [ | ||
'@Symfony' => true, | ||
'binary_operator_spaces' => [ | ||
'operators' => [ | ||
'=>' => 'align', | ||
], | ||
], | ||
'blank_line_after_opening_tag' => false, // <?php declare(strict_types=1); | ||
'single_quote' => true, | ||
'yoda_style' => true, | ||
'no_empty_phpdoc' => true, | ||
'no_extra_blank_lines' => true, | ||
'phpdoc_align' => true, | ||
'phpdoc_trim' => true, | ||
'increment_style' => ['style' => 'post'], | ||
'no_superfluous_phpdoc_tags' => true, | ||
'declare_strict_types' => true, | ||
]; | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in('src') | ||
->in('tests'); | ||
|
||
return PhpCsFixer\Config::create() | ||
->setFinder($finder) | ||
->setRiskyAllowed(true) | ||
->setRules($rules) | ||
->setUsingCache(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# CHANGELOG | ||
|
||
## 1.3 | ||
|
||
- all setters return $this. | ||
- getters for type `D` (Date) now returns date string in 'Ymd' format instead of timestamp. | ||
- `VisualFoxproRecord::getDateTime` returns object of `\DateTimeInterface` instead of timestamp. | ||
|
||
### deprecated | ||
|
||
- setters like getType are deprecated. Use set('name', $value) method instead. | ||
- getters like getType are deprecated. Use get('name') method instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace XBase; | ||
|
||
/** | ||
* Used to store and merge memo deleted area. | ||
* | ||
* @author Alexander Strizhak <gam6itko@gmail.com> | ||
* | ||
* @internal | ||
*/ | ||
final class BlocksMerger | ||
{ | ||
private $blocksToDelete = []; | ||
|
||
public function add(int $pointer, int $length): self | ||
{ | ||
$this->blocksToDelete[] = [$pointer, $length]; | ||
|
||
return $this; | ||
} | ||
|
||
public function clear(): void | ||
{ | ||
$this->blocksToDelete = []; | ||
} | ||
|
||
public function get(): array | ||
{ | ||
return $this->squeeze(); | ||
} | ||
|
||
private function squeeze(): array | ||
{ | ||
$pointers = array_column($this->blocksToDelete, 0); | ||
array_multisort($pointers, SORT_ASC, $this->blocksToDelete); | ||
|
||
$result = []; | ||
$i = null; | ||
$nextPointer = null; | ||
foreach ($this->blocksToDelete as $arr) { | ||
[$pointer, $length] = $arr; | ||
if ($pointer < $nextPointer) { | ||
continue; | ||
} elseif ($nextPointer === $pointer) { | ||
$result[$i] += $length; | ||
} else { | ||
$i = $pointer; | ||
$result[$pointer] = $length; | ||
} | ||
$nextPointer = $pointer + $length; | ||
} | ||
|
||
return $result; | ||
} | ||
|
||
public function isEmpty(): bool | ||
{ | ||
return empty($this->blocksToDelete); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.