PHP Classes

File: src/eMacros/Runtime/Type/IsEmpty.php

Recommend this page to a friend!
  Classes of Emmanuel Antico   eMacros   src/eMacros/Runtime/Type/IsEmpty.php   Download  
File: src/eMacros/Runtime/Type/IsEmpty.php
Role: Class source
Content type: text/plain
Description: Class source
Class: eMacros
PHP LISP language interpreter
Author: By
Last change:
Date: 10 years ago
Size: 549 bytes
 

Contents

Class file image Download
<?php
namespace eMacros\Runtime\Type;

use
eMacros\Runtime\GenericFunction;

class
IsEmpty extends GenericFunction {
   
/**
     * Determines if a value evaluates to empty
     * Usage: (empty value)
     * Returns: boolean
     * (non-PHPdoc)
     * @see \eMacros\Runtime\GenericFunction::execute()
     */
   
public function execute(array $arguments) {
        if (empty(
$arguments)) {
            throw new \
BadFunctionCallException('IsEmpty: No parameters found.');
        }
       
        foreach (
$arguments as $arg) {
            if (!empty(
$arg)) {
                return
false;
            }
        }
           
        return
true;
    }
}
?>