Git Product home page Git Product logo

opensourceevangelist's Introduction

Open Source Evangelist

Coverage Status Build Status Scrutinizer Code Quality

--

This package aims to provide an analysis based on the number of open source projects an individual possess on Github.This Package uses PSR-4 Autoload Standard.

    Number of repository < 5: None Evangelist.
    Number of repository >= 5 and Number of repository <= 10 : Junior Evangelist.
    Number of repository >= 11 and Number of repository <= 20 : Associate Evangelist.
    Number of repository >= 21 : Senior Evangelist.

Install

Via Composer

$ composer require pyjac/opensourceevangelist

Usage

	require 'vendor/autoload.php';

	use Pyjac\OpenSourceEvangelist\OpenSourceEvangelist;
	use Pyjac\OpenSourceEvangelist\OpenSourceEvangelistDataSource;
	use Pyjac\OpenSourceEvangelist\OpenSourceEvangelistFactory;
	use Pyjac\OpenSourceEvangelist\Exception\OpenSourceEvangelistNotFoundException;

	try
	{
		$openSourceEvangelist = new OpenSourceEvangelist(new OpenSourceEvangelistDataSource(), new OpenSourceEvangelistFactory());
		$evangelist = $openSourceEvangelist->getEvangelist('pyjac');
		echo $evangelist->getStatus();
	} catch(OpenSourceEvangelistNotFoundException $ex){
		echo $ex->getMessage();
	}
	

The OpenSourceEvangelist class

The OpenSourceEvangelist class receives two instances of OpenSourceEvangelistDataSource and OpenSourceEvangelistFactory class.

	$openSourceEvangelist = new OpenSourceEvangelist(new OpenSourceEvangelistDataSource(), new OpenSourceEvangelistFactory());

You can implement your own by implementing the below interface for the class OpenSourceEvangelistDataSource.

//Pyjac\OpenSourceEvangelist\OpenSourceEvangelistDataSourceInterface

interface OpenSourceEvangelistDataSourceInterface
{
	 /**
     * Get data of the provided username from the data source.
     *
     * @param string $username
     *
     * @throws Pyjac\OpenSourceEvangelist\Exception\OpenSourceEvangelistNotFoundException
     *
     * @return \stdClass
     */
    public function getEvangelistData($username);
}

And the below interface for the class OpenSourceEvangelistFactory.

//Pyjac\OpenSourceEvangelist\OpenSourceEvangelistFactoryInterface

interface OpenSourceEvangelistFactoryInterface
{
	/**
     * Factory method to create an instance of an evangelist.
     *
     * @param string $username
     * @param int    $repos
     *
     * @return Pyjac\OpenSourceEvangelist\Evangelist\EvangelistAbstract
     */
    public function createEvangelist($username, $repos);
}

The getEvangelist method

The getEvangelist method returns an object of an evangelist.

	$evangelist = $openSourceEvangelist->getEvangelist('pyjac');

	echo $evangelist->getStatus();
	echo $evangelist->getUsername();
	echo $evangelist->getRank();
	echo $evangelist->getNumberOfRepos();

Exceptions

`OpenSourceEvangelistNotFoundException`: This exception is thrown when the provided Github username is not found.

Security

If you discover any security related issues, please email Oyebanji Jacob or create an issue.

Credits

Oyebanji Jacob

License

The MIT License (MIT)

Copyright (c) 2016 Oyebanji Jacob [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

opensourceevangelist's People

Stargazers

 avatar fokosun avatar

Watchers

James Cloos avatar Oyebanji Jacob Mayowa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.