Skip to content

[pull] master from CopernicaMarketingSoftware:master #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2022
Merged
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
21 changes: 5 additions & 16 deletions include/classtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Internal class types enumeration.
*
* @author Emiel Bruijntjes <[email protected]>
* @copyright 2014 Copernica BV
* @copyright 2014 - 2022 Copernica BV
*/

/**
Expand All @@ -13,22 +13,11 @@
namespace Php {

/**
* Enumeration definition.
*
* The PHP-CPP library tries to hide the Zend engine internals completely from
* the user. Therefore, it does not include any of the Zend header files, nor
* can it refer to the constants defined in the Zend header files. The
* following constants have been copied from Zend. If the Zend engine ever
* changes (which we do not expect) we should also copy the constant values
* used here.
*
* Enumeration declaration
* The definition of the variables can be found in the Zend directory,
* so that we can use the macro's from the PHP header files.
*/
enum class ClassType {
Regular = 0x00,
Abstract = 0x20,
Final = 0x04,
Interface = 0x40,
};
enum class ClassType;

/**
* End namespace
Expand Down
6 changes: 3 additions & 3 deletions include/interface.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Interface.h
*
* @copyright 2014 Copernica BV
* @copyright 2014 - 2022 Copernica BV
* @author Emiel Bruijntjes <[email protected]>
*/

Expand All @@ -20,12 +20,12 @@ class PHPCPP_EXPORT Interface : private ClassBase
* Constructor
* @param name
*/
Interface(const char *name) : ClassBase(name, ClassType::Interface) {}
Interface(const char *name);

/**
* Destructor
*/
virtual ~Interface() {}
virtual ~Interface() = default;

/**
* Add a - of course abstract - method to the interface
Expand Down
34 changes: 34 additions & 0 deletions zend/classtype.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @file classtype.h
*
* Internal class types enumeration.
*
* @author Emiel Bruijntjes <[email protected]>
* @copyright 2014 - 2022 Copernica BV
*/

/**
* Include guard
*/
#pragma once

/**
* Set up namespace
*/
namespace Php {

/**
* Enumeration definition.
* This is different for different PHP versions
*/
enum class ClassType {
Regular = 0x00,
Interface = ZEND_ACC_INTERFACE,
Abstract = ZEND_ACC_ABSTRACT,
Final = ZEND_ACC_FINAL,
};

/**
* End namespace
*/
}
3 changes: 2 additions & 1 deletion zend/includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Startup include file to compile the phpcpp library
*
* @author Emiel Bruijntjes <[email protected]>
* @copyright 2013 - 2019 Copernica BV
* @copyright 2013 - 2022 Copernica BV
*/

/**
Expand Down Expand Up @@ -117,6 +117,7 @@
* Specific zend implementation files for internal use only
*/
#include "init.h"
#include "classtype.h"
#include "callable.h"
#include "nativefunction.h"
#include "method.h"
Expand Down
30 changes: 30 additions & 0 deletions zend/interface.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Interface.cpp
*
* Implementation file for the Interface class
*
* @author Emiel Bruijntjes <[email protected]>
* @copyright 2022 Copernica BV
*/

/**
* Dependencies
*/
#include "includes.h"

/**
* Begin of namespace
*/
namespace Php {

/**
* Constructor
* @param name
*/
Interface::Interface(const char *name) : ClassBase(name, ClassType::Interface) {}

/**
* End of namespace
*/
}