Skip to content

Instantly share code, notes, and snippets.

@jeffikus

jeffikus/teacher-class-compress.php Secret

Last active Jan 6, 2021
Embed
What would you like to do?
<?php
/**
* CODE IS POETRY
*
* @package STUDENT LEARNING
* @since 11.09.2020
*/
if( ! class_exists( 'LEARN_TO_PROGRAM' ) ) :
/**
* LEARN_TO_PROGRAM
*
* @since 11.09.2020
*/
class LEARN_TO_PROGRAM {
/**
* Let's begin
*/
private static $begin;
public $student_attributes = array( 'respect', 'learning', 'ambitious');
public $class_defaults = array( 'safe', 'family', 'happy' );
public boolean $kindess;
public $student_count = 0;
public $school_classes = (object) [
'Pixies', 'Sprites', 'Unicorns', 'Frogs',
'Squirrels', 'Ladybirds', 'Butterflies',
'Ducks', 'Otters', 'Rabbits', 'Kestrels',
'Foxes', 'Owls', 'Eagles', 'Wolves'
];
/**
* Constructor
*
* @since 11.09.2020
*/
public function __construct() {
foreach ( $student as $name => $surname ) {
switch ( student_value( $name, $surname ) ) {
case 'adventurous':
if ( !array_search( 'adventurous', $student_attributes ) ) {
array_push( $student_attributes, 'adventurous' );
}
break;
case 'adaptable':
array_reverse( $student_attributes );
break;
case 'gentle':
print_r( array_values( $student_attributes ) );
break;
case 'kind':
$this->kindness = true;
break;
default:
if ( empty( $student_attributes ) ) {
array_replace( $student_attributes, $class_defaults );
}
break;
}
$student_count++;
}
}
/**
* Student Values
*
* @since 11.09.2020
*/
private function student_value( $name = '', $surname = '' ) {
if ( in_array( get_student_list(), $name . ' ' . $surname ) ) {
return $student_value_name;
}
}
/**
* Initiator
*
* @since 11.09.2020
*/
public static function begin(){
if ( ! isset( self::$begin ) && is_altruistic() ) {
self::$begin = new self;
}
return self::$begin;
}
}
/**
* Kicking this off by calling 'begin()' method
*/
LEARN_TO_PROGRAM::begin();
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment