Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/vendor/*
/vendor/
.phpunit.result.cache
.phpunit.cache
.phpunit
auth.json
composer.lock
Expand Down
7 changes: 4 additions & 3 deletions backend/class/app.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

namespace codename\core\io;

/**
* testing
*/
class app extends \codename\core\app {

}
class app extends \codename\core\app
{
}
21 changes: 12 additions & 9 deletions backend/class/datasource.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<?php namespace codename\core\io;
<?php

namespace codename\core\io;

use Iterator;

/**
* datasource base class
*/
abstract class datasource implements \Iterator, progressInterface {

/**
* (re-)configure the datasource
* @param array $config [datasource config array]
*/
public abstract function setConfig(array $config);

abstract class datasource implements Iterator, progressInterface
{
/**
* (re-)configure the datasource
* @param array $config [datasource config array]
*/
abstract public function setConfig(array $config);
}
149 changes: 78 additions & 71 deletions backend/class/datasource/arraydata.php
Original file line number Diff line number Diff line change
@@ -1,88 +1,95 @@
<?php

namespace codename\core\io\datasource;

use codename\core\io\datasource;

/**
* [arraydata description]
*/
class arraydata extends \codename\core\io\datasource {

/**
* [setData description]
* @param array $data [description]
*/
public function setData(array $data) {
$this->data = $data;
$this->elementCount = count($this->data);
}
class arraydata extends datasource
{
/**
* @var array
*/
protected array $data;

/**
* [protected description]
* @var int
*/
protected $elementCount = null;
/**
* [protected description]
* @var int
*/
protected int $elementCount;

/**
* @inheritDoc
*/
public function setConfig(array $config)
{
return;
}
/**
* [setData description]
* @param array $data [description]
*/
public function setData(array $data): void
{
$this->data = $data;
$this->elementCount = count($this->data);
}

/**
* @inheritDoc
*/
public function current()
{
return current($this->data);
}
/**
* {@inheritDoc}
*/
public function setConfig(array $config): void
{
}

/**
* @inheritDoc
*/
public function next()
{
return next($this->data);
}
/**
* {@inheritDoc}
*/
public function next(): void
{
next($this->data);
}

/**
* @inheritDoc
*/
public function key()
{
return key($this->data);
}
/**
* {@inheritDoc}
*/
public function valid(): bool
{
return $this->current() !== false;
}

/**
* @inheritDoc
*/
public function valid()
{
return $this->current() !== false;
}
/**
* {@inheritDoc}
*/
public function current(): mixed
{
return current($this->data);
}

/**
* @inheritDoc
*/
public function rewind()
{
reset($this->data);
}
/**
* {@inheritDoc}
*/
public function rewind(): void
{
reset($this->data);
}

/**
* @inheritDoc
*/
public function currentProgressPosition() : int
{
return $this->key();
}
/**
* {@inheritDoc}
*/
public function currentProgressPosition(): int
{
return $this->key();
}

/**
* @inheritDoc
*/
public function currentProgressLimit() : int
{
return $this->elementCount;
}
/**
* {@inheritDoc}
*/
public function key(): mixed
{
return key($this->data);
}

/**
* {@inheritDoc}
*/
public function currentProgressLimit(): int
{
return $this->elementCount;
}
}
Loading