Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

00f100/fcphp-repository

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

00f100/fcphp-repository

Package to manipulate repositories

Source
Packagist
Version
0.1.0
Version published
Maintainers
1
Created
Source

FcPhp Repository

Abstract class to Repository FcPhp

Build Status codecov

PHP Version Packagist Version Total Downloads

How to install

Composer:

$ composer require 00f100/fcphp-repository

or add in composer.json

{
    "require": {
        "00f100/fcphp-repository": "*"
    }
}

How to use

namespace Path\To
{
    use FcPhp\Repository\Repository;

    class ExampleRepository extends Repository
    {

    }
}
Configure dependencies

use Exception;
use FcPhp\Di\Facades\DiFacade;
use FcPhp\Datasource\Factories\Factory;
use FcPhp\Cache\Facades\CacheFacade;
use FcPhp\Datasource\Interfaces\IQuery;

$di = DiFacade::getInstance();
$factory = new Factory($di);
$cache = CacheFacade::getInstance('path/to/cache');
Create instance and define error callback
use Path\To\ExampleRepository;

// See: github.com/00f100/fcphp-datasource
$datasource = new Datasource();

$callbackError = function(IQuery $query, Exception $e) {
    $this->assertInstanceOf(IQuery::class, $query);
    $this->assertInstanceOf(Exception::class, $e);
};

$instance = new ExampleRepository($datasource, $cache, $factory, $callbackError);

// Query
$query = $instance->getQuery();

FAQs

Package last updated on 29 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts