Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Mergeable.php #45

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Archiver/BaseArchiver.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ abstract class BaseArchiver extends BaseHandler
*
* @param string $path The path to the file
*
* @throws FileNotFoundException
*
* @return bool Success or failure
*
* @throws FileNotFoundException
*/
protected function putContents($path, string $data): bool
{
Expand Down
8 changes: 4 additions & 4 deletions src/Collectors/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Schema extends BaseCollector
*/
protected $schema;

//--------------------------------------------------------------------
// --------------------------------------------------------------------

/**
* Load a copy of the schema.
Expand All @@ -73,7 +73,7 @@ public function getTitleDetails(): string
return '(' . (is_countable($this->schema->tables) ? count($this->schema->tables) : 0) . ' tables)';
}

//--------------------------------------------------------------------
// --------------------------------------------------------------------

/**
* Returns the data of this collector to be formatted in the toolbar
Expand All @@ -97,7 +97,7 @@ public function display(): string
return $html;
}

//--------------------------------------------------------------------
// --------------------------------------------------------------------

/**
* Gets the "badge" value for the button.
Expand All @@ -107,7 +107,7 @@ public function getBadgeValue(): int
return empty($this->schema->tables) ? 0 : count($this->schema->tables);
}

//--------------------------------------------------------------------
// --------------------------------------------------------------------

/**
* Display the icon.
Expand Down
16 changes: 8 additions & 8 deletions src/Config/Schemas.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class Schemas extends BaseConfig
'read' => true,
];

//--------------------------------------------------------------------
// --------------------------------------------------------------------
// Drafting
//--------------------------------------------------------------------
// --------------------------------------------------------------------

// Default handlers used to create a schema (order sensitive)
// (Probably shouldn't change this unless you really know what you're doing)
Expand All @@ -40,9 +40,9 @@ class Schemas extends BaseConfig
// Path the directoryHandler should scan for schema files
public $schemasDirectory = APPPATH . 'Schemas';

//--------------------------------------------------------------------
// --------------------------------------------------------------------
// Archiving
//--------------------------------------------------------------------
// --------------------------------------------------------------------

// Default handlers to archive copies of the schema
public $archiveHandlers = [
Expand All @@ -52,16 +52,16 @@ class Schemas extends BaseConfig
// Default time-to-live for a stored schema (e.g. Cache) in seconds
public $ttl = 14400; // 4 hours

//--------------------------------------------------------------------
// --------------------------------------------------------------------
// Reading
//--------------------------------------------------------------------
// --------------------------------------------------------------------

// Default handler used to return and read a schema
public $readHandler = 'Tatter\Schemas\Reader\Handlers\CacheHandler';

//--------------------------------------------------------------------
// --------------------------------------------------------------------
// Publishing
//--------------------------------------------------------------------
// --------------------------------------------------------------------

// Precaution to prevent accidental wiping of databases or files
public $safeMode = true;
Expand Down
3 changes: 2 additions & 1 deletion src/Structures/Mergeable.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
use ArrayIterator;
use Countable;
use IteratorAggregate;
use stdClass;
use Traversable;

class Mergeable implements Countable, IteratorAggregate
class Mergeable extends stdClass implements Countable, IteratorAggregate
{
/**
* Merge two structures together.
Expand Down
1 change: 0 additions & 1 deletion tests/read/CacheReaderTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

use Tatter\Schemas\Reader\Handlers\CacheHandler as CacheReader;
use Tatter\Schemas\Structures\Schema;
use Tatter\Schemas\Structures\Table;
use Tests\Support\CacheTrait;
use Tests\Support\MockSchemaTrait;
Expand Down